package com.sq.partner.manager.dao.impl;

import com.sq.partner.manager.dao.CtripDao;
import com.sq.partner.manager.util.LogUtil;
import com.sq.partner.manager.util.Page;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

@Repository
public class CtripDaoImpl extends BaseDaoImpl implements CtripDao {

    private static Logger logger = LogUtil.getLog(CtripDaoImpl.class);

    @Override
    public Page queryStatisticsPage(Page page) throws Exception {
        List queryList = queryList("queryStatisticsPage", page.getMap());
        Long queryCount = (Long)query("queryStatisticsCount", page.getMap());

        page.setData(queryList);
        page.setTotal(queryCount);
        return page;
    }

    @Override
    public Page queryPolicyPageByEffecttime(Page page) throws Exception {
        List queryList = queryList("queryCtripPolicyPage", page.getMap());
        Long queryCount = (Long)query("queryCtripPolicyCount", page.getMap());

        page.setData(queryList);
        page.setTotal(queryCount);
        return page;
    }

    @Override
    public List<Map<String, Object>> queryAllPolicyByEffecttime(Page page) throws Exception {
        List<Map<String, Object>> queryList = queryList("queryAllPolicyByEffecttime",page.getMap());
        return queryList;
    }
}
